/*
 * @Author: zhangpeng
 * @Date: 2024-11-20 17:17:57
 * @FilePath: \scientific_research_manager_web\src\api\resultsManagement\verticalInitiationApi.ts
 * @LastEditTime: 2024-12-03 08:44:17
 * @Description: 成果-纵向立项api
 */
import request from '@/utils/request'
import { PageBeanVerticalPageVO, VerticalPageReqDTO, VerticalUpdateReqOpenDTO } from './types'

// 纵向立项 分页查询
export function getVerticalListApi(params: VerticalPageReqDTO) { 
  return request<PageBeanVerticalPageVO>({
    url: `/achv/vertical/page`,
    method: 'post',
    data: params
  })
}

// 获取 纵向立项 详情
export function getVerticalDetailApi(params) { 
  return request({
    url: `/achv/vertical/detail`,
    method: 'post',
    data: params
  })
}

// 纵向更新
export function updateVerticalDetailApi(params: VerticalUpdateReqOpenDTO) { 
  return request({
    url: `/achv/vertical/update`,
    method: 'post',
    data: params
  })
}

// 成果 - 纵向新增
export function createVerticalDetailApi(params) { 
  return request({
    url: `/achv/vertical/create`,
    method: 'post',
    data: params
  })
}

/**
 * 导出 纵向立项
 * @param {number} unStatus 不包含状态
 * @param {string} createdBy 创建人id
 * @param {string} departmentId 部门id
 * @param {string} idList 导出id
*/
export function exportVerticalApi(params: { unStatus?: number, createdBy?: string, departmentId?: string, idList?: string[] }) {
  return request({
    url: `/achv/vertical/export`,
    method: 'post',
    responseType: 'blob',
    data: params
  })
}